﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IdentityModel.Tokens;
using Microsoft.IdentityModel.Tokens;

namespace Veracruz.IdentityModel
{
    public class NoCheckIssuerNameRegistry : IssuerNameRegistry
    {
        #region methods

        public override string GetIssuerName(SecurityToken securityToken)
        {
            X509SecurityToken l_x509Token = securityToken as X509SecurityToken;
            if (l_x509Token != null)
            {
                return l_x509Token.Certificate.SubjectName.Name;
            }
            throw new SecurityTokenException("Untrusted issuer.");
        }

        #endregion
    }
}
